home *** CD-ROM | disk | FTP | other *** search
- /*
- File: RealShpe.h
-
- Contains: RealShape class, private to ODShape.
-
- Owned by: Jens Alfke
-
- Copyright: 1993-94 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <7> 5/25/95 jpa Use new GX headers [1241078, 1253324]
- <6> 2/24/95 jpa Removed local ODNewRgn. [1220810]
- <5> 12/5/94 jpa Code review cleanup [1203923]
- <4> 10/24/94 jpa Added ODNewRgn. [1151710]
- <3> 8/8/94 jpa Added Outset method [1178690]
- <2> 8/2/94 jpa Added AsPolygonShape.
- <1> 6/15/94 jpa first checked in
- --------Moved to SOM project and rearranged-----
- <7> 5/9/94 jpa Enable polygon clipper and GX support
- [1162090]
- <6> 3/15/94 MB Changes to support SCpp/ASLM builds,
- #1150864.
- <5> 2/17/94 JA Declare XMPPolygon as struct, not class.
- <4> 2/16/94 JA Include new AltPoint.h.
- <3> 2/10/94 JA Stop using ptrs to member fns.
- <2> 2/9/94 JA Renamed from ShapePrv.h --> ShapePvM.h
- <6> 2/7/94 JA Further tigerings.
- <5> 2/3/94 JA Tiger Team Makeover!
- <4> 1/31/94 JA XMPRealShape no longer derives from
- XMPAbsShape. Other API improvements.
- <3> 11/24/93 VL Rolled back changes as ASLM build breaks
- the THINK build.
- <2> 11/23/93 VL Made this work with ASLM.
- <1> 11/23/93 JA first checked in
-
- In Progress:
-
- */
-
-
- #ifndef _REALSHPE_
- #define _REALSHPE_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef __GXTYPES__
- #include <GXTypes.h> /* for gxShape type */
- #endif
-
- #ifndef _POLYCLIP_
- #include "PolyClip.h" /* for ODShapeOp enum*/
- #endif
-
- #ifndef __QUICKDRAW__
- #include <QuickDraw.h> /* for Region type*/
- #endif
-
-
- //==============================================================================
- // Classes used in this interface
- //==============================================================================
-
- class ODShape;
-
- class PolygonShape;
-
- //==============================================================================
- // QuickDraw Classic/GX Utilities
- //==============================================================================
-
- void ClearGXError( );
- void ThrowIfGXError( );
- void ThrowIfFirstGXError( );
-
- //==============================================================================
- // RealShape
- //==============================================================================
-
- class RealShape {
- public:
-
- RealShape( ODGeometryMode );
- virtual ~RealShape( );
-
- ODVMethod ODSize Purge(ODSize size);
-
- ODMethod void SetGeometryMode( ODGeometryMode );
- ODMethod ODGeometryMode GetGeometryMode( );
-
- ODVMethod RealShape* SetPolygon( const ODPolygon& );
- ODVMethod void Simplify( ); // Implemented only by PolygonShape
-
- ODMethod ODPlatformShape GetPlatformShape( ODGraphicsSystem );
- ODVMethod void SetPlatformShape( ODGraphicsSystem, ODPlatformShape );
-
- inline RgnHandle GetQDRegion( )
- {return (RgnHandle)this->GetPlatformShape(kODQuickDraw);}
-
- ODVMethod ODBoolean HasGeometry( );
-
- ODVMethod RealShape* Clear( );
-
- static RealShape* NewGeometricShape( ODGeometryMode mode );
-
- // Abstract stubs (these basically follow the ODShape interface:)
-
- ODVMethod void GetBoundingBox( ODRect *bounds )
- = 0;
- ODVMethod RealShape* SetRectangle( const ODRect *rect )
- = 0;
- ODVMethod void CopyPolygon( ODPolygon& )
- = 0;
- ODVMethod ODBoolean IsSameAs( RealShape* compareShape)
- = 0;
- ODVMethod ODBoolean IsEmpty( )
- = 0;
- ODVMethod ODBoolean ContainsPoint( ODPoint point )
- = 0;
- ODVMethod ODBoolean IsRectangular( )
- = 0;
- ODVMethod RealShape* Copy( )
- = 0;
- ODVMethod RealShape* Transform(Environment*, ODTransform* transform)
- = 0;
- ODVMethod RealShape* Outset(ODCoordinate distance)
- = 0;
- ODVMethod RealShape* Subtract( RealShape* diffShape )
- = 0;
- ODVMethod RealShape* Intersect(RealShape* sectShape)
- = 0;
- ODVMethod RealShape* Union( RealShape* unionShape )
- = 0;
-
- ODVMethod RealShape* Combine( ODShapeOp, RealShape* );
-
- #if ODDebug
- char GetType( ) const {return fType;}
- #endif
-
- protected:
-
- ODVMethod RealShape* ReplaceWith( RealShape* ); // Delete me & return copy of shape
- ODVMethod RealShape* AsPolygonShape( ); // Return equivalent polygon/GX shape
- ODMethod RealShape* Promote( ODShapeOp =kShapeNoOp,
- RealShape* =NULL); // Convert & perform op
-
- ODVMethod gxShape CopyGXShape( ) // Return a GX shape
- = 0;
- ODVMethod void InitQDRegion( ) // Called when fQDRegion needs to be set
- = 0;
-
- #if ODDebug
- char fType; // Number identifying class type:
- #endif /* 0=Rect, 1=Rgn, 2=Poly, 3=GX*/
-
- ODGeometryMode fMode; // Geometry mode
- RgnHandle fQDRegion; // Cached QuickDraw region
- };
-
-
- extern ODBoolean gGX; // Is GX installed?
-
-
- #endif /*_REALSHPE_*/